/*
 * 知识管理
 * */

import http from '@/utils/http';

/*
 * 关键词回复
 * */

// 关键词回复 列表
export async function antistopReplyList(params) {
  return http.post('/cloud/qa/keyword/getKeywordListJson', params);
}

// 关键词修改
export async function antistopAlter(params) {
  return http.postWithStatus('/cloud/qa/keyword/setKeyword', params);
}

// 关键词 新增保存
export async function antistopSave(params) {
  return http.postWithStatus('/cloud/qa/keyword/addKeyword', params);
}

// 关键词 删除
export async function antistopDelete(params) {
  return http.postWithStatus('/cloud/qa/keyword/delKeyword', params);
}

// 关键词 词典列表
export async function dictionaryList(params) {
  return http.getToken('/cloud/new/knowledge/keyword/reply/dict/chosen', params);
}

// 关键词 选择词典验证
export async function dictionaryCertification(params) {
  return http.post('/cloud/qa/keyword/checkDict', params);
}

/*
 * 知识库共享
 * */

// 查询分享的知识点列表
export async function shareList(params) {
  return http.post('/cloud/share/shared-category/getSharedCategoryList', params);
}

export async function newShareList(params) {
  return http.post('/cloud/new/knowledge/share/list', params);
}

// 分享的知识点
export async function shareKnowledge(params) {
  return http.postWithStatus('/cloud/share/shared-category/doShare', params);
}

export async function newShareKnowledge(params) {
  return http.post('/cloud/new/knowledge/share/doShare', params);
}
// 查询分享知识点内容
export async function inquireShare(params) {
  return http.getToken('/cloud/new/knowledge/share/categoryTree', params);
}

// 删除分享的知识点
export async function deleteShare(params) {
  return http.postWithStatus('/cloud/share/shared-category/deleteSharedCategory', params);
}

/*
 * 知识库总览
 * */

 // 知识库智能维护 问题库列表
export async function knowledgeQuestionList(params) {
  return http.postData('/cloud/new/learn/knowledge/question/list', params);
}

// 知识库总揽 分类树
export async function knowledgeClassification(params) {
  return http.post('/cloud/new/knowledge/base/getCategoryTree', params);
}

// 知识库总揽 删除分类
export async function knowledgeDelete(params) {
  return http.post('/cloud/robot/deleteCategoryJson', params);
}

// 知识库总揽 启用分类
export async function knowledgeDisableOpen(params) {
  return http.post('/cloud/new/knowledge/base/category/enable', params);
}

// 知识库总揽 停用分类
export async function knowledgeDisableOpens(params) {
  return http.post('/cloud/new/knowledge/base/category/disable', params);
}

// 知识库总揽 修改分类名称
export async function knowledgeClassifyName(params) {
  return http.post('/cloud/robot/renameCategoryJson', params);
}

// 知识库总揽 移动分类
export async function knowledgeMoveClassify(params) {
  return http.post('/cloud/new/knowledge/base/category/move', params);
}

// 知识库总揽 添加分类
export async function knowledgeAddClassify(params) {
  return http.post('/cloud/new//knowledge/base/addCategory', params);
}

// 知识库总揽 搜索知识点列表
export async function knowledgeSeekList(params) {
  return http.post('/cloud/new/knowledge/base/getQaList', params);
}

// 知识库总揽 上移下移分类
export async function knowledupOrDownCategory(params) {
  return http.post('/cloud/new/knowledge/base/upOrDownCategory', params);
}

// 知识库总揽 知识点合并接口
export async function knowledcombine(params) {
  return http.post('/cloud/qa/combine', params);
}

// 知识库总览 知识点删除接口
export async function knowledDelete(params) {
  return http.post('/cloud/qa/delete', params);
}

// 相似问模板 获取相似问模板列表
export async function knowledQuestionTemplateList(params) {
  return http.post('/cloud/qa/questionTemplateList', params);
}

// 相似问模板 替换模板问题占位符
export async function knowledQuestionTemplateValues(params) {
  return http.post('/cloud/qa/questionTemplateValues', params);
}

// 知识库管理 提交相似问
export async function knowaddQuestion(params) {
  return http.post('/cloud/new/knowledge/base/addQuestion', params);
}

// 根据词槽id查询词槽详情
export async function fetchSlotDetailBySlotId(params) {
  return http.post('/cloud/new/knowledge/base/getSlotValues', params);
}

//  知识库管理 获取知识点问题推荐任务状态
export async function baseQaRecommendStatus(params) {
  return http.getToken('/cloud/new/knowledge/base/qaRecommend/status', params);
}

//  知识库管理 获取知识点问题推荐任务进度
export async function baseQaRecommendProcess(params) {
  return http.getToken('/cloud/new/knowledge/base/qaRecommend/process', params);
}

// 知识库管理 获取知识点问题推荐任务结果列表
export async function qaRecommendList(params) {
  return http.postData('/cloud/new/knowledge/base/qaRecommend/list', params);
}

// 知识库管理 提交知识点问题推荐任务
export async function qaRecommendSubmit(params) {
  return http.post('/cloud/new/knowledge/base/qaRecommend/submit', params);
}






// 保存知识点

export async function saveQA(params) {
  return http.post('/cloud/new/knowledge/base/saveQa', params);
}

// 知识点启用、停用

export async function updateQaStatus(params) {
  return http.post('/cloud/new/knowledge/base/disableOrEnable', params);
}


// 知识库管理 知识点详情（不包含标准问、相似问和答案）

export async function getKnowledgeDetail(params) {
  return http.post('/cloud/new/knowledge/base/getKnowledgeDetail', params);
}

// 知识库管理 详情 答案列表

export async function getQAJsonAnswers(params) {
  return http.post('/cloud/new/knowledge/base/qa/answer', params);
}

// 知识点相似问

export  async function getAlikeQuestionList(params) {
  return http.post('/cloud/new/knowledge/base/getAlikeQuestionList',params)
}


// 知识点标准问

export  async function getStandardQuestion(params) {
  return http.post('/cloud/new/knowledge/base/getStandardQuestion',params)
}

// 知识库管理 修改相似问
export async function editQustion(params) {
  return http.post('/cloud/new/knowledge/base/editQustion', params);
}

// 知识库管理 删除相似问
export async function deleteQuestion(params) {
  return http.post('/cloud/new/knowledge/base/deleteQuestion', params);
}

// 知识库管理 设置标准问
export async function topQuesion(params) {
  return http.post('/cloud/new/knowledge/base/topQuesion', params);
}

// 知识库管理 知识点移动分类
export async function updateQACategory(params) {
  return http.post('/cloud/new/knowledge/base/moveQaToCategory', params);
}

// 知识库管理 知识点导出
export async function exportQA(params) {
  return http.downloadFile('/cloud/new/knowledge/base/export', params);
}

// 分类取消共享
export async function deleteSharedCategory(params) {
  return http.post('/cloud/new//knowledge/base/category/unshare', params);
}
/*
 * 修改记录
 * */

// 下载记录列表
export async function getQAHistories(params) {
  return http.post('/cloud/robot/getQAHistories', params);
}

// 下载记录
export async function exportQAHistories(params) {
  return http.downloadFile('/cloud/new/knowledge/modify/record/export', params);
}

// 删除历史记录接口
export async function clearQAHistories(params) {
  return http.post('/cloud/robot/clearQAHistories', params);
}



/*
 * 回收站
 * */

// 搜索回收站知识点
export async function getQARecycle(params) {
  return http.post('/cloud/new/knowledge/recycle/list', params);
}

// 还原回收站知识点
export async function restoreQAJson(params) {
  return http.post('/cloud/new/knowledge/recycle/restoreQa', params);
}

// 彻底删除知识点
export async function removeQAForeverJson(params) {
  return http.post('/cloud/robot/removeQAForeverJson', params);
}

// 清空机器人回收站中的所有数据
export async function clearQARecycleJson(params) {
  return http.post('/cloud/robot/clearQARecycleJson', params);
}

// 知识点导入
export async function knowledgeImport(params) {
  return http.uploadFile('/cloud/new/knowledge/base/import', params);
}

// 获取qaId
export async function getQaIdByRequest(params) {
  return http.getToken('/cloud/new/knowledge/base/qaId', params);
}

// 获取导入模版
export async function getQaTemplate(params) {
  return http.downloadFile('/cloud/new/knowledge/base/import/template', params);
}



/*
 * 业务知识库
 * */

// 查询
export async function businessGetList(params) {
  return http.postData('/cloud/jsdl/business/getList', params);
}

// 新增
export async function businessDoAdd(params) {
  return http.postData('/cloud/jsdl/business/doAdd', params);
}

// 编辑
export async function businessDoEdit(params) {
  return http.postData('/cloud/jsdl/business/doEdit', params);
}

// 删除
export async function businessdoRemove(params) {
  return http.postData('/cloud/jsdl/business/doRemove', params);
}

// 获取指标名称列表
export async function getDictWordList(params) {
  return http.postData('/cloud/jsdl/business/getDictWordList', params);
}


/*
 * 业务文档
 * */

 // 文件列表
export async function cloudResIndex(params) {
  return http.getTokenData('/cloud/res/index', params);
}

 // 下载文件
 export async function businesxz(url,params) {
  return http.downloadFile(url, params);
}

 // 删除文件
 export async function removeFile(params) {
  return http.getTokenData('/cloud/res/removeFile', params);
}
